<?php 
/**
 * @todo 用户登录页面
 * @author machao
 */
define('_VIEW_MODEL_','default');
require_once("./init.php");
if(!empty($_POST)){ // post提交 插入数据
	$formData = $_POST;
	$formData['phone'] = trim($formData['phone']);
	$password = md5($formData['password']);
	$userInf = $db->getRow("select id,name,phone from {$telper}user where phone = '".$formData['phone']."' and password = '$password'");		
	empty($userInf)?errorPrompt('login_error','login.php'):setLoginSession($userInf['id']);
	redirect('bookhouse.php');exit;
}else{
	header("Content-type:text/vnd.wap.wml;charset=utf-8");
	$smartyObj->display('login.tpl');
}
?>